﻿@using UcAsp.Net.Model;
@using UcAsp.Net.BLL;
@using UcAsp.Net.Comm
@using Config = UcAsp.Net.BLL.SettingConfig;
@using Clear = UcAsp.Net.BLL.ClearCodeBLL;
@using Categorie = UcAsp.Net.BLL.Categorie;
@using Tags=UcAsp.Net.BLL.ArticleTags;
@{
    Layout = "~/themes/default/Shared/_Layout.cshtml";
}

@model UcAsp.Net.Model.ArticelsViews
@{
    ViewBag.Title = Model.Title+Model.CategorieName;
    ViewBag.Keywords = Model.MetaKeyword + Model.CategorieName;
    ViewBag.Description = Model.Description ;
}
<div class="container-fluid headerpath">
    @(new HtmlString(Categorie.MenuPath(Model.CategorieID)))
</div>
<div class="container-fluid">
    <div class="row">
        <div class="col-lg-9 col-md-9 col-xs-12 articles">
            <section>
                <header>
                    <h2>@Model.Title</h2>
                </header>
                <article>
                    @if (!string.IsNullOrEmpty(Model.IconUrl))
                    {
                        <img src="@Model.IconUrl" /> <br />
                    }
                    @(new HtmlString(Clear.ClearCode(Model.ArticleContent)))

                    @(new HtmlString(Tags.GetTagsUrl(Model.Tag)))
                </article>
                <footer>
                    <div class="btn-group">

                        <a class="btn btn-info" href="/@ViewData["categorieshowpath"]/@(Utils.GetPagePath(Model.ShowPath, Model.ID)).shtml">
                            第一页
                        </a>
</a>

                        @for (int i = 1; i < int.Parse(@ViewData["pagesend"].ToString()); i++)
                        {
                            if (i == 1)
                            {
                                <a class="btn btn-info" href="/@ViewData["categorieshowpath"]/@(Utils.GetPagePath(Model.ShowPath, Model.ID)).shtml">@i</a>
                            }
                            else
                            {
                                <a class="btn btn-info" href="/@ViewData["categorieshowpath"]/@(Utils.GetPagePath(Model.ShowPath, Model.ID))_@(i).shtml">@i</a>
                            }
                        }
                        @(new HtmlString(ViewData["EndTxt"].ToString()))

                        <a class="btn btn-info" href="/@ViewData["categorieshowpath"]/@(Utils.GetPagePath(Model.ShowPath, Model.ID))_@(int.Parse(ViewData["Count"].ToString()) + 1).shtml">
                            最后一页
                        </a>
                    </div>
                </footer>
            </section>
        </div>
        <div class="col-lg-3 col-md-3 articles_right">
             @(new HtmlString(AdvConfig.GetAdvPositions("AD4", Config.Theme(Request.UserAgent)).AdvHtml))
        </div>
    </div>
</div>

@{
    List<ArticelsViews> list = (List<ArticelsViews>)ViewData["NextOrPrev"];
    if (list != null)
    {
        ArticelsViews Prev = list[0];
        ArticelsViews Next = list[1];
        if (Prev != null)
        { 
            <a class="btn btn-info" href="/@ViewData["categorieshowpath"]/@(Utils.GetPagePath(Prev.ShowPath, Prev.ID)).shtml">@Prev.Title</a>
        }
        if (Next != null)
        { 
            <a class="btn btn-info" href="/@ViewData["categorieshowpath"]/@(Utils.GetPagePath(Next.ShowPath, Next.ID)).shtml">@Next.Title</a>
        }
    }
}